package cn.chenhuanming.shh.administer.entity.jpa;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * HouseDetails entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "house_details", catalog = "house")
public class HouseDetails implements java.io.Serializable {

	// Fields

	private Integer id;
	private House house;
	private String codeKey;
	private String codeValue;

	// Constructors

	/** default constructor */
	public HouseDetails() {
	}

	/** full constructor */
	public HouseDetails(House house, String codeKey, String codeValue) {
		this.house = house;
		this.codeKey = codeKey;
		this.codeValue = codeValue;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "house_id", nullable = false)
	public House getHouse() {
		return this.house;
	}

	public void setHouse(House house) {
		this.house = house;
	}

	@Column(name = "code_key", nullable = false)
	public String getCodeKey() {
		return this.codeKey;
	}

	public void setCodeKey(String codeKey) {
		this.codeKey = codeKey;
	}

	@Column(name = "code_value", nullable = false)
	public String getCodeValue() {
		return this.codeValue;
	}

	public void setCodeValue(String codeValue) {
		this.codeValue = codeValue;
	}

}